<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8"/>
    <title>表达式</title>
</head>
<body>
<#--一、直接确认值-->
<#--1.字符串(转义)-->
  ${"It's \"quoted\" and
this is a backslash: \\"}  <br/>
<#--字符串中包含${等  可以利用r来声明是字符串-->
${r"${foo}"} <br/>


<#--4.序列-->
<#list [1,2,3] as x >
    ${x}
</#list> <br/>


<#--5.值域-->
<#--a.  1..3   [1,2,3]
b.  1..<3  [1,2]
c.  1..*5  [1,2,3,4,5]    5==length-->
<#list 1..*5 as x >
    ${x}
</#list> <br/>


<#--二、字符串操作-->
<#--1.赋值-->
<#assign s="hello!  ${people[0]}" />
${s}   <br/>

<#--序列切分-->
<#assign s = ["A","B","C"] />
<#list s[0..1] as tmp>
    ${tmp}
</#list>  <br/>








<#--*******内建函数-->
${"123"?length}

${"mercury"?upper_case}

${(user.xixi)!"hahahah"}

<#if (user.xixi)??>
    123
    <#else >
    456
</#if>
</body>
</html>